//
//  SISSRepaymentRedemptionViewModel.m
//  SISSAPP
//
//  Created by 袁应荣 on 2018/10/25.
//  Copyright © 2018年 优房网. All rights reserved.
//

#import "SISSRepaymentRedemptionViewModel.h"

@implementation SISSRepaymentRedemptionViewModel

- (NSString *)plistName {
    return @"RepaymentRedemptionInfoArray";
}

- (UIView *)getViewHeaderInSection:(NSInteger)section {
    
    SISSBaseView *headerView = [[SISSBaseView alloc] init];
    headerView.backgroundColor = [UIColor groupTableViewBackgroundColor];
    UILabel *label = [[UILabel alloc] init];
    label.textColor = COLOR(0x334A60);
    label.font = [UIFont systemFontOfSize:16];
    [headerView addSubview:label];
    
    CGFloat margin = 8.0;
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(headerView).offset(2 * margin);
        make.centerY.equalTo(headerView);
    }];
    
    NSArray *headerTextArr = @[@"买方贷款银行放赎楼款", @"担保公司还款情况", @"补充说明"];
    
    label.text = headerTextArr[section];
    
    return headerView;
}

- (CGFloat)getHeightForHeaderInSection:(NSInteger)section {
    return 44;
}

- (SISSRepaymentRedemptionModel *)dataArrToRepaymentRedemptionModel {
    SISSRepaymentRedemptionModel *model = [[SISSRepaymentRedemptionModel alloc] init];
    model.bank = self.dataArr[0][0].rightStr;
    model.amount = self.dataArr[0][1].rightStr;
    model.loanDate = self.dataArr[0][2].rightStr;
    model.repaymentAmount = self.dataArr[1][0].rightStr;
    model.interest = self.dataArr[1][1].rightStr;
    model.repaymentDate = self.dataArr[1][2].rightStr;
    model.otherdesc = self.dataArr[2][0].rightStr;
    return model;
}

@end
